#
#  Copyright 2008 Garth Williams
#
#  This file is part of CommandPost.
#
#  CommandPost is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  CommandPost is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with CommandPost.  If not, see <http://www.gnu.org/licenses/>.
#

class CreateReports < ActiveRecord::Migration
  def self.up
    create_table :reports do |t|
      t.string :title
      t.text :data_captured
      t.integer :stage_id
      t.integer :assigned_to_user_id
      t.integer :milestone_id
      t.integer :priority_id
      t.boolean :closed, :default => false
      t.integer :created_by_user_id
      t.integer :version
      t.timestamp :deleted_at

      t.timestamps
    end
    
    Report.create_versioned_table
  end

  def self.down
    Report.drop_versioned_table
    
    drop_table :reports
  end
end
